<div style="float:right;"><?php echo $this->href( "role", "list", "Editar Roles" ) ?></div>
<p>El siguiente listado muestra los usuarios elija uno para editarlo.</p>


<? if (count($this->paginator)): ?>
<table class="listclass" width="100%" border="0" cellpadding="0" cellspacing="0">
    <thead>
      <tr>
            <th width="10%" align="left">ID</th>
            <th width="10%" align="left">Usuario</th>
            <th width="10%" align="left">Owner</th>
            <th width="15%" align="left">Fecha de creacion</th>
            <th width="10%" align="left">Estado</th>
            <th width="15%" align="left">Fecha de baja</th>
            <th colspan= 2 width="20%" align="left">Accion</th>
      </tr>
    </thead>

    <tbody>
        <? $i=0; foreach ($this->paginator as $user) : ?>
              <tr class=<?php echo ($i%2==0?'"even clickable"':'"odd clickable"') ?> 
                onclick="document.location='<?php echo $this->url( array( 'controller'=>'user','action'=>'edit', 'userId'=> $user->user_id ), "default" )?>'">
                    <td valign="top"><?php echo $user->user_id; ?></td>
                    <td valign="top"><?php echo $user->username ?></td>
                    <td valign="top"><?php echo $user->owner_id ?></td>
                    <td valign="top"><?php echo $user->creation_date->toString('dd/MM/YYYY') ?></td>
                    <td valign="top"><?php echo $user->locked=="T"?"Bloqueado":"Activo" ?></td>
                    <td valign="top"><?php echo is_null($user->end_date)?"":$user->end_date->toString('dd/MM/YYYY') ?></td>
                    <td valign="top">
                        <? if (is_null($user->end_date)) : ?>
                            <?php echo $this->href( "user", "delete", "Dar de Baja", array( "userId" => $user->user_id ) ) ?>
                        <? else : ?>
                            <?php echo $this->href( "user", "unDelete", "Reactivar", array( "userId" => $user->user_id ) ) ?>
                        <? endif; ?>
                    </td>
                    <td valign="top">
                        <?php echo $this->href( "user", "role", "Asignar Roles", array( "userId" => $user->user_id ) ) ?>
                    </td>
              </tr>
        <? $i++; endforeach; ?>
    </tbody>
</table>
<?php echo $this->paginator ?>
<? endif; ?>
<p>
<?php echo $this->href( "user", "edit", "Crear un nuevo usuario" ) ?>
</p>

